package ac.beiwo.baas.object.entity;

import com.alibaba.fastjson.JSONObject;

import java.util.Date;
import java.util.LinkedHashMap;
import java.util.Map;

/**
 * Created by Staryet on 15/6/23.
 */
public class BaasObject extends JSONObject {

    public BaasObject() {
        super();
    }

    public BaasObject(Map<String, Object> m) {
        super(m);
    }

    public String getId() {
        return (String) get("id");
    }

    public BaasAcl getAcl() {
        return (BaasAcl) get("acl");
    }

    public Date getCreatedAt() {
        Date date = new Date();
        date.setTime(getLong("createdAt"));
        return date;
    }

    public Date getUpdatedAt() {
        Date date = new Date();
        date.setTime(getLong("updatedAt"));
        return date;
    }

}
